﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.ServiceModel.DomainServices.Client;
using System.ComponentModel;
using MyApp.Domain.DomainServices;
using System.Windows.Data;
using MyApp.Data.Model;
using System.Collections.Generic;
using System.Linq;

namespace MyApp.Modules.Orders.Models
{
    public class ProductModel
    {
        private MyAppContext context;

        public ProductModel()
        {
            this.context = new MyAppContext();
        }

        public void FetchProductList(Action<IPagedCollectionView> callback)
        {
            var query = context.GetProductsQuery();
            context.Load(query, LoadBehavior.RefreshCurrent, op =>
            {
                callback(CreateCollectionView(op));
            }, null);
        }

        private IPagedCollectionView CreateCollectionView(LoadOperation<Product> loadOp)
        {
            return null;
        }
    }
}
